package gxdlxy.zx2202.chat5;

import java.io.IOException;

public class Example4 {
    public static void main(String[] args) throws InterruptedException, IOException {
        Runtime rt = Runtime.getRuntime();
        System.out.println(rt.freeMemory() / 1024 / 1024 + "MB");
        System.out.println(rt.maxMemory() / 1024 / 1024 + "MB");
        System.out.println(rt.totalMemory() / 1024 / 1024 + "MB");
//        rt.exec("C://windows//notepad.exe");
        System.out.println(rt.availableProcessors());

        // 数学操作
        float f = -12.3f;
        System.out.println("原数：" + f);
        System.out.println("绝对值：" + Math.abs(f));
        System.out.println("开根号：" + Math.sqrt(361));
        System.out.println("取上整：" + Math.ceil(f));
        System.out.println("取下整：" + Math.floor(f));
        System.out.println("四舍五入：" + Math.round(f));
        System.out.println("最大值：" + Math.max(f, 100));
        System.out.println("最大值：" + Math.min(f, 100));
        System.out.println("生成随机数：" + Math.random());
        System.out.println("开方：" + Math.pow(2, 10));
    }
}
